package com.hsc.yalebao.zhuanpan;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.model.GiftHistoryModel;
import com.hsc.yalebao.tools.UiUtil;
import java.util.ArrayList;
import java.util.HashMap;

public class PrizeHistoryListAdapter extends BaseAdapter
{
  String TAG = "AccountChangeListAdapter";
  private Context context;
  int count = 1;
  ViewHolder holder = null;
  private LayoutInflater inflater;
  int itemWidth;
  private ArrayList<GiftHistoryModel> list;
  HashMap<Integer, View> mapView = new HashMap();
  private String savePoint;
  int screenWidth;

  public PrizeHistoryListAdapter(Context paramContext, ArrayList<GiftHistoryModel> paramArrayList)
  {
    this.context = paramContext;
    this.inflater = LayoutInflater.from(paramContext);
    this.list = paramArrayList;
    this.screenWidth = CustomApplication.app.displayMetrics.widthPixels;
    this.itemWidth = ((this.screenWidth - 2 * UiUtil.dip2px(paramContext, 10.0F)) / 3);
  }

  public int getCount()
  {
    if (this.list == null)
      return 0;
    return this.list.size();
  }

  public Object getItem(int paramInt)
  {
    return this.list.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    GiftHistoryModel localGiftHistoryModel;
    String str1;
    label130: String str2;
    int j;
    if (paramView == null)
    {
      this.holder = new ViewHolder();
      paramView = this.inflater.inflate(2130903211, null);
      this.holder.mTimeTv = ((TextView)paramView.findViewById(2131099850));
      this.holder.mLevelTv = ((TextView)paramView.findViewById(2131100335));
      this.holder.mMoneyTv = ((TextView)paramView.findViewById(2131100334));
      paramView.setTag(this.holder);
      localGiftHistoryModel = (GiftHistoryModel)this.list.get(paramInt);
      str1 = localGiftHistoryModel.getTime();
      if ((str1 != null) && (!str1.equals("")))
        break label287;
      this.holder.mTimeTv.setText("");
      int i = Integer.valueOf(localGiftHistoryModel.getLevel()).intValue();
      str2 = "一";
      j = this.context.getResources().getColor(2131165335);
      switch (i)
      {
      default:
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
      }
    }
    while (true)
    {
      this.holder.mLevelTv.setText(str2 + "星红包");
      this.holder.mLevelTv.setTextColor(j);
      this.holder.mMoneyTv.setText(localGiftHistoryModel.getMoney() + "元宝");
      return paramView;
      this.holder = ((ViewHolder)paramView.getTag());
      break;
      label287: String[] arrayOfString = str1.trim().split(" ");
      this.holder.mTimeTv.setText(arrayOfString[0] + "\n" + arrayOfString[1]);
      break label130;
      str2 = "一";
      j = this.context.getResources().getColor(2131165335);
      continue;
      str2 = "二";
      j = this.context.getResources().getColor(2131165335);
      continue;
      str2 = "三";
      j = this.context.getResources().getColor(2131165335);
      continue;
      str2 = "四";
      j = Color.parseColor("#ff00f0");
      continue;
      str2 = "五";
      j = Color.parseColor("#8400ff");
    }
  }

  public void setData(ArrayList<GiftHistoryModel> paramArrayList)
  {
    this.list = paramArrayList;
  }

  public class ViewHolder
  {
    public TextView mLevelTv;
    public TextView mMoneyTv;
    public TextView mTimeTv;

    public ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.zhuanpan.PrizeHistoryListAdapter
 * JD-Core Version:    0.6.2
 */